<!-- 书城界面，展示所有书籍 -->

<template>
	<view class="bd">
		<!--search start-->
		<view class="search">
			<view class="fixedHeader search_in ">
				<uni-search-bar class="search1" placeholder="搜索书籍" @confirm="search()"></uni-search-bar>
			</view>

		</view>
		<!--search end-->

		<view class="book-kinds">
			<view class="book-kinds-item">

				<image src="../../static/041_星球.png" class="book-kinds-item-pic"></image>
				<view class="book-kinds-item-text">精品书单</view>
			</view>
			<!-- 		<view class="shuxian" style="height: 100%; background-color: rgb(240, 240,240); width: 2rpx;margin: auto;">
				
			</view> -->
			<view class="book-kinds-item">
				<image src="../../static/041_艺术.png" class="book-kinds-item-pic"></image>
				<view class="book-kinds-item-text">文学小说</view>
			</view>

			<view class="book-kinds-item">
				<image src="../../static/041_收藏-17.png" class="book-kinds-item-pic"></image>
				<view class="book-kinds-item-text">科技科普</view>
			</view>

			<view class="book-kinds-item">
				<image src="../../static/041_数据-29.png" class="book-kinds-item-pic"></image>
				<view class="book-kinds-item-text">管理学问</view>
			</view>
		</view>
		<view class="blank" style="height: 30rpx;"></view>
		<!-- 全部书籍展示 -->

		<BookItem></BookItem>

	</view>
</template>

<script>
	import {
		gotoUrl
	} from "@/utils.js"
	import BookItem from './item.vue'
	import {
		getBookByMsg, //获取书籍信息
	} from '@/config/api.js'
	export default {
		components: {
			BookItem
		},
		data() {
			return {
				getBookMsg: {},
				gotoUrl,
			}
		},
		onLoad() {
			this.getBookMsgFun()
		},
		onLaunch() {
			this.getBookMsgFun()
		},
		methods: {
			search(e) {
				gotoUrl(`/pages/index/search?keyword=${e.value}`)
			}
		}
	}
</script>

<style scoped lang="scss">
	.search_in {
		.search1 {
			width: 100%;

		}

		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 20rpx;
		box-sizing: border-box;
		height: 80rpx;
		width: 710rpx;
		// margin-bottom: 20rpx;
		background-color: #ffffff;
		border-radius: 35rpx;
		margin-left: auto;
		margin-right: auto;
		margin-top: 20rpx;
	}

	.book-lists-item-name {
		font-size: 0.9rem;
		font-weight: bold;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.book-lists-item-pic {
		margin-top: 15rpx;
		border: 1rpx gainsboro solid;
		width: 300rpx;
		height: 280rpx;
	}

	.book-lists-items {
		text-align: center;
		width: 100%;

		height: auto;

		display: flex;
		flex-direction: row;
		justify-content: space-between;
		flex-wrap: wrap;
		border-radius: 20rpx;
	}

	.book-lists-item {
		width: 350rpx;
		/* height: 400rpx; */
		margin: 10rpx;
		border-radius: 30rpx;
		box-sizing: border-box;

		height: auto;
		display: inline-block;

		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;


		background-color: white;
	}

	.book-lists {
		margin-top: 20rpx;
		width: 100%;
		flex: 1;
		height: auto;

		background-color: rgba(243, 242, 238, 0.5);
		// background-color: rgb(248, 248,248);
	}

	.book-kinds-item-pic {

		width: 90rpx;
		height: 90rpx;
	}

	.book-kinds-item {
		font-size: 24rpx;
		flex: 1;
		text-align: center;
		box-shadow: 1rpx;
	}

	.book-kinds {

		margin: 0 auto;
		padding-top: 16rpx;
		width: 95%;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: rgba(243, 242, 238, 0.3);

	}

	.bd {
		width: 100%;
		height: 100%;

		display: flex;
		flex-direction: column;
		background-color: rgba(243, 242, 238, 0.3);
		// background: linear-gradient(to right,rgb(239, 244, 255) 0%,rgb(255,255,255) 49%,rgb(255,255,255) 50%,rgb(255, 249, 244) 100%);
	}
</style>